package com.googlecode.jasmincc.framework.configuration;

import java.util.*;

public class Config {
	protected String name;

	protected String type;

	protected ArrayList<String> extensions = new ArrayList<String>();

	protected Hashtable<String, String> options = new Hashtable<String, String>();

	/**
	 * @return the name
	 */
	public String getName() {
		return name;
	}

	/**
	 * @param name the name to set
	 */
	public void setName(String name) {
		this.name = name;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	public void addOption(String name, String value) {
		options.put(name, value);
	}

	public void addExtension(String ext) {
		extensions.add(ext);
	}

	public boolean isMatchingExtension(String ext) {
		for (String e : extensions) {
			if (ext.equalsIgnoreCase(e)) {
				return true;
			}
		}

		return false;
	}
}
